<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="/css/bootcss.css">
    <style>
        .loginbox {
            float: right;
        }
    </style>
</head>

<body>
    <div class="container">
        <a href="./addnote">添加笔记</a>
        <p class="loginbox">
            <% if(username){%>
                尊贵的：<%=username%> 您好。
                    <a href="/center">个人中心</a>
                    <a href="/logout">退出登录</a>
                    <% }else{ %>
                        <a href="/login">登录</a>
                        <a href="/register">注册</a>
                        <%}%>
        </p>
        <table  class="table table-hover">
            <% data.forEach(item=>{%>
                <tr>
                    <td><a href="/detail/<%=item.id%>">
                        <%=item.title%>
                    </a></td>
                    <!-- <span>time</span> -->
                    <td><a href="/update?id=<%=item._id%>">编辑</a></td>
                    <td><a href="/delnote/<%=item._id%>">删除</a></td>
                </tr>
                <%})%>
        </table>
    </div>
</body>

</html>